package com.springmvc.controller;

import jakarta.servlet.ServletContext;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class ApplicationScopeTestController {
    @RequestMapping("/testApplicationScope")
    public String testApplicationScope1(HttpServletRequest  request){
        ServletContext application = request.getServletContext();
        application.setAttribute("testApplicationScope", "在spring当中使用原生servlet API完成application域共享");
        return "Ok";

    }
}
